#include "CNode.h"

#ifndef VECTOR_HEADER
    #include <vector>
    #define VECTOR_HEADER
#endif

#ifndef STRING_HEADER
    #include <string>
    #define STRING_HEADER
#endif

#ifndef SDL_HEADER
    #include "SDL/SDL.h"
    #define SDL_HEADER
#endif

#ifndef CGRID_HEADER
#define CGRID_HEADER
class CGrid
{
    public:
		CGrid(char* Filename, unsigned int Width, unsigned int Height);
        ~CGrid();

    public:
        CNode::CNode*  GetNode(unsigned int X, unsigned int Y);
        std::vector<CNode::CNode*> GetAdjacentNodes(unsigned int X, unsigned int Y);

        void DrawAllNodes(SDL_Surface* Screen);

    public:
        CNode::CNode* StartNode;
        CNode::CNode* EndNode;

    private:
        void importGrid(char* Filename);
        std::vector<std::string> getFile(char* Filename);

        void addNode(unsigned int X, unsigned int Y, char Type);

    private:
        unsigned int _HNodeCount;
        unsigned int _VNodeCount;

        unsigned int _Width;
        unsigned int _Height;

        unsigned int nodeWidth;
        unsigned int nodeHeight;

        std::vector<CNode::CNode*> Nodes;
};
#endif // #IFNDEF CGRID_HEADER
